<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import OnlineStatusEnum from '@/framework/constant/OnlineStatusEnum'
import BusinessTypeEnum from '@/framework/constant/BusinessTypeEnum'
import CURDTable from '@/framework/components/table/CURDTable'

import { alleyGuideApi } from '@/feature/ag/infra/api/alleyGuideApi'

export default {
  components: {CURDTable},
  data() {
    return {
      option: {
        requestApi: alleyGuideApi,
        showSelection: true,
        loadDetail: true,
        columns: [
          {
            label: '文章名称',
            prop: 'title',
            searchable: true,
            required: true,
            width: 'auto'
          },
          {
            label: '分类',
            searchable: true,
            type: ColumnType.RADIO,
            width: 'auto',
            options: BusinessTypeEnum,
            required: true,
            prop: 'businessType'
          },
          {
            label: '文章封面',
            type: ColumnType.IMAGE,
            prop: 'cover',
            searchable: true,
            required: true,
            width: 'auto'
          },
          {
            label: '配图',
            type: ColumnType.IMAGE,
            prop: 'urlList',
            hiddenInTable: true,
            width: 'auto',
            dataType: 'array'
          },
          {
            label: '文章简介',
            type: ColumnType.TEXTAREA,
            hiddenInTable: true,
            required: true,
            width: 400,
            prop: 'briefly',
            span: 24
          },
          {
            label: '内容',
            type: ColumnType.RICH_EDITOR,
            required: true,
            hiddenInTable: true,
            span: 24,
            prop: 'intro'
          },
          {
            label: '状态',
            searchable: true,
            type: ColumnType.RADIO,
            width: 80,
            hiddenInForm: true,
            options: OnlineStatusEnum,
            prop: 'status'
          },
          {
            label: '创建时间',
            width: 140,
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            width: 140,
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          },
          {
            label: '排序号',
            span: 24,
            required: true,
            width: 80,
            defaultValue: 0,
            prop: 'sortNum',
            type: ColumnType.NUMBER
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

